<template>
	<div class="news">
        <div class="top">今日头条新闻</div>
        <div v-show='isShow'>请求超过每日可允许请求次数!暂无数据</div>
		<div class="main">
            <div class="title">{{list.title}}</div>
		    <div v-for="i of list.list">
                <ul class="list">
                    <li>
                        <span class="left">{{i.link1text}}</span>
                        <span class="center">{{i.link2text}}</span>
                        <span class="right">{{i.m_time}}</span>
                    </li>
                    <li>
                        <span class="left">{{i.player1}}<img v-bind:src="i.player1logo" align="middle"></span>
                        
                        <span class="center">{{i.score}}</span>

                        <span class="right"><img v-bind:src="i.player2logo" align="middle">{{i.player2}}</span>
                    </li>
                </ul>
            </div>
		</div>
        <foot></foot>
	</div>
</template>
<script type="text/javascript">
	// import $ from 'jquery'
    import footer from '../public/footer'
	export default {
        components:{
            'foot':footer
        },
        data:function (argument) {
        	return {
                isShow:false,
                state:'',
        		list:''
        	}
        },
        created:function () {
            var _this = this;
            // NBA
            var key = 'b5ca2acdab01c88c99d532cdfb5c3aa2';
            $.ajax({
                type:"get",
                dataType:"json",
                // url:'http://op.juhe.cn/onebox/basketball/nba?key='+key,
                url:'http://op.juhe.cn/onebox/basketball/team?key='+key+'&team=骑士',
                success:function (data) 
                {   
                    // console.log(data);

                    _this.state = data.error_code;
                    if (data.error_code!=0) {
                        _this.isShow = !_this.isShow;
                    }
                    if (data.result!=null) {
                        _this.list = data.result
                    }
                }
            });
        }
    }
</script>
<style scoped>
    @import '../../assets/css/news.css'
</style>